import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/eims/inTransitUnit/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/eims/inTransitUnit',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/eims/inTransitUnit/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/eims/inTransitUnit/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/eims/inTransitUnit',
    method: 'put',
    data: obj
  })
}

//根据unitId，关联所有在途信息
export function inTransitUnitInsert(unitId) {
  return request({
    url: '/eims/inTransitUnit/saveAll/' + unitId,
    method: 'get'
  })
}


//根据unitId，获取关联的所有在途信息
export function getAllInfo(unitId) {
  return request({
    url: '/eims/inTransitUnit/getAllInfo/' + unitId,
    method: 'get'
  })
}

//根据id修改状态
export function editStatusById(id) {
  return request({
    url: '/eims/inTransitUnit/editStatus/'+id,
    method: 'get'
  })
}
